package com.lpit.controller;

import com.lpit.dto.ArticleSearchDto;
import com.lpit.pojo.Article;
import com.lpit.result.ResponseResult;
import com.lpit.service.ArticleSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RestController
public class ArticleSearchController {

    @Autowired
    private ArticleSearchService articleSearchService;

    /**
     * 搜索文章
     * @param articleSearchDto
     * @return
     * @throws IOException
     */
    @GetMapping("/searchArticle")
    public ResponseResult<List<?>> searchArticle(ArticleSearchDto articleSearchDto) throws IOException {
        return articleSearchService.searchArticle(articleSearchDto);
    }
}
